<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul,li{
            list-style: none;
        }
        ul{
            margin: 100px;
            display: flex;
        }
        ul li{
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: pink;
            margin-right: 20px;
        }
    </style>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</head>
<body>
    <script src="./js/jquery.js"></script>
    <script>
        /* li的点击事件 */
        $("li").click(function(){
            // console.log(this);
            //将JS代码转换成JQ代码
            // $(this)

            //先将自己的背景颜色修改成功红色,然后再将兄弟的颜色修改绿色
            // $(this).css("background","red").siblings().css("background","green")


            //获取点击的下标
            console.log($(this).index());
        })
    </script>
</body>
</html>